home *** CD-ROM | disk | FTP | other *** search
- package sun.font;
-
- import java.awt.Font;
- import java.awt.Graphics2D;
- import java.awt.Rectangle;
- import java.awt.Shape;
- import java.awt.font.FontRenderContext;
- import java.awt.font.GlyphVector;
- import java.awt.geom.AffineTransform;
- import java.awt.geom.Rectangle2D;
-
- public class TextSourceLabel extends TextLabel {
- TextSource source;
- // $FF: renamed from: lb java.awt.geom.Rectangle2D
- Rectangle2D field_0;
- // $FF: renamed from: ab java.awt.geom.Rectangle2D
- Rectangle2D field_1;
- // $FF: renamed from: vb java.awt.geom.Rectangle2D
- Rectangle2D field_2;
- // $FF: renamed from: ib java.awt.geom.Rectangle2D
- Rectangle2D field_3;
- // $FF: renamed from: gv java.awt.font.GlyphVector
- GlyphVector field_4;
-
- public TextSourceLabel(TextSource var1) {
- this(var1, (Rectangle2D)null, (Rectangle2D)null, (GlyphVector)null);
- }
-
- public TextSourceLabel(TextSource var1, Rectangle2D var2, Rectangle2D var3, GlyphVector var4) {
- this.source = var1;
- this.field_0 = var2;
- this.field_1 = var3;
- this.field_4 = var4;
- }
-
- public TextSource getSource() {
- return this.source;
- }
-
- public final Rectangle2D getLogicalBounds(float var1, float var2) {
- if (this.field_0 == null) {
- this.field_0 = this.createLogicalBounds();
- }
-
- return new Rectangle2D.Float((float)(this.field_0.getX() + (double)var1), (float)(this.field_0.getY() + (double)var2), (float)this.field_0.getWidth(), (float)this.field_0.getHeight());
- }
-
- public final Rectangle2D getVisualBounds(float var1, float var2) {
- if (this.field_2 == null) {
- this.field_2 = this.createVisualBounds();
- }
-
- return new Rectangle2D.Float((float)(this.field_2.getX() + (double)var1), (float)(this.field_2.getY() + (double)var2), (float)this.field_2.getWidth(), (float)this.field_2.getHeight());
- }
-
- public final Rectangle2D getAlignBounds(float var1, float var2) {
- if (this.field_1 == null) {
- this.field_1 = this.createAlignBounds();
- }
-
- return new Rectangle2D.Float((float)(this.field_1.getX() + (double)var1), (float)(this.field_1.getY() + (double)var2), (float)this.field_1.getWidth(), (float)this.field_1.getHeight());
- }
-
- public Rectangle2D getItalicBounds(float var1, float var2) {
- if (this.field_3 == null) {
- this.field_3 = this.createItalicBounds();
- }
-
- return new Rectangle2D.Float((float)(this.field_3.getX() + (double)var1), (float)(this.field_3.getY() + (double)var2), (float)this.field_3.getWidth(), (float)this.field_3.getHeight());
- }
-
- public Rectangle getPixelBounds(FontRenderContext var1, float var2, float var3) {
- return this.getGV().getPixelBounds(var1, var2, var3);
- }
-
- public AffineTransform getBaselineTransform() {
- Font var1 = this.source.getFont();
- return var1.hasLayoutAttributes() ? AttributeValues.getBaselineTransform(var1.getAttributes()) : null;
- }
-
- public Shape getOutline(float var1, float var2) {
- return this.getGV().getOutline(var1, var2);
- }
-
- public void draw(Graphics2D var1, float var2, float var3) {
- var1.drawGlyphVector(this.getGV(), var2, var3);
- }
-
- protected Rectangle2D createLogicalBounds() {
- return this.getGV().getLogicalBounds();
- }
-
- protected Rectangle2D createVisualBounds() {
- return this.getGV().getVisualBounds();
- }
-
- protected Rectangle2D createItalicBounds() {
- return this.getGV().getLogicalBounds();
- }
-
- protected Rectangle2D createAlignBounds() {
- return this.createLogicalBounds();
- }
-
- private final GlyphVector getGV() {
- if (this.field_4 == null) {
- this.field_4 = this.createGV();
- }
-
- return this.field_4;
- }
-
- protected GlyphVector createGV() {
- Font var1 = this.source.getFont();
- FontRenderContext var2 = this.source.getFRC();
- int var3 = this.source.getLayoutFlags();
- char[] var4 = this.source.getChars();
- int var5 = this.source.getStart();
- int var6 = this.source.getLength();
- GlyphLayout var7 = GlyphLayout.get((GlyphLayout.LayoutEngineFactory)null);
- StandardGlyphVector var8 = var7.layout(var1, var2, var4, var5, var6, var3, (StandardGlyphVector)null);
- GlyphLayout.done(var7);
- return var8;
- }
- }
-